import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import * as filters from './common/filters';

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-default/index.css';
import IconSvg from './components/icon-svg/index.vue';
import VuePreview from 'vue-preview';

Vue.use(ElementUI);
Vue.use(VuePreview);
Vue.component('icon-svg', IconSvg);

Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});

Vue.config.productionTip = false;

const debug = process.env.NODE_ENV !== 'production';
Vue.config.devtools = debug;

new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: {App},
  data:{
    eventHub:new Vue()
  }
});
